<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <style>
        *{list-style: none;}
        .box ul{display: flex; justify-content: center; margin-top: 30px;}
        li{width: 100px; height: 100px; background: yellowgreen; margin-left: 30px;}
    </style>     -->
</head>
<body>


</body>

<script>
    var obj = {
        name:'张三',
        age:20,
        skill:function(){
            console.log(this)
        }
    }
    obj.skill()
</script>
<!-- <div class="box">
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</div>
<script>
    var odiv  = document.getElementsByTagName('li')
    for(var a=0;a<5;a++) {
    // 这里因为odiv绑定了a,所以a不能大于odiv的最大下标值
        odiv[a].onclick = function(){
            console.log(this)
            // 指向事件本身
        }
    }    
        
</script> -->



   <!--  <img id="img" src="./image/cun1.jpg" alt="">
<script>
   var img = document.getElementById('img')
   var n = 1;
   img.onclick = function(){
        if(n < 4) {
            n++
        }
        img.src = './image/cun' + n + '.jpg'
   }
</script> -->

<!-- <div id="box"></div>
<script>
    var img=document.getElementById("box")
    img.style.width="100px"
    img.style.height="100px"
    img.style.background="red"
    // 在js中不允许出现  "-"   解决：  -后面单词的首字母大写  去除-
    console.log(img.style.width); //100px
    console.log('hello'); //30px
</script> -->
<!-- 
//多个设置
<div id="box" style="font-size: 18px">asjkd</div>
<script>
    var img=document.getElementById("box")
    img.style.cssText="background:#000;width:100px;height:100px;"
    console.log(img.style.background)
    console.log(img.style.fontSize)

</script> -->

<!-- //操作元素属性
<div id="box">你本是天上绝色 属于璀璨星河</div>
<p><input type="text" class="inp"> <button class="btn">改变背景颜色</button></p>
<p><input type="text" class="inp"> <button class="btn">改变字体大小</button></p>
<p><input type="text" class="inp"> <button class="btn">改变宽度</button></p>
<p><input type="text" class="inp"> <button class="btn">改变高度</button></p>

<script>
    var box = document.getElementById("box");
    var inp = document.getElementsByClassName("inp");
    var bun = document.getElementsByClassName("btn");

    bun[0].onclick = function(){
        if(isNaN(inp[0])) {
        box.style.background=inp[0].value
        }else {
        box.style.background="#" + inp[0].value

        }
};
bun[1].onclick = function(){
    box.style.fontSize=inp[1].value + "px"
    
}

bun[2].onclick = function(){
    box.style.width=inp[2].value + "px"
    
}
bun[3].onclick = function(){
    box.style.height=inp[3].value + "px"
    
} -->

<!-- <div id="box"></div>
<script>
    var box=document.getElementById("box")
    box.style.width="100px"
    box.style.height="100px"
    box.style.background="red"
    // 在js中不允许出现  "-"   解决：  -后面单词的首字母大写  去除-
    console.log(box.style.fontSize); //30px
</script> -->


<!-- </script> -->
<!-- <script>
    var num = 100;
    console.log(typeofnum))
</script> -->

<!-- <div id="box" style="width:100px;" title="21345769"></div> -->
<!-- <script>
const c = console.log.bind(document)
    // var string = 'asdad'
    // console.log(string.length)  // 5

    // var string = 'asdad'
    // console.log(string.charAt(0))  // a
    
// 删除数组中的name
// var obj={
// 	name:"李四",
// 	age:"18",
// 	type:"1"
// }
// console.log(obj)
// delete obj.name
// console.log(obj)

    // 声明动态属性
    // var set = 'color'
    // var obj = {
    //     name:'zhangsan',
    //     [set]:'red',
    // }
    // console.log(obj)

//         a(90)
//         c(78)

// var arr = [1,2,3,4]
// // arr = []
// // arr.length = 0
// c(arr)

// console.log(parseInt('asd'))  // NAN     

// const str2 = 'R123'
// const num2 = +str2
// console.log(num2);          // NaN
// console.log(typeof num2)    // number

// const str1 = 123
// const num1 = +str1
// c(num1)

// const a1 = "123.125"
// const aa = 123.155
// c(aa.toFixed(2)) // 123.56 会自动四舍五入

// const a = 'asd';
// const a1 = JSON.stringify(a)
// c(a1)
// c(JSON.parse(a1))

// var odiv =document.getElementById('box')

// console.log(odiv.title); 		//21345769

// console.log(odiv['title']);		//21345769

// var v = "title"
// console.log(odiv[v]);			//21345769

// var d = 'width'
// console.log(odiv.style[d]);
// var n = 'width'
// c(odiv.style[n])


</script>  -->
</html>